package zb.WX.util;

import java.io.IOException;
import java.util.Properties;

/*
 * 读取properties文件中的内容
 */
public class PropertiesUtil {
    private static Properties prop;

    static {
        prop = new Properties();
        try {
            prop.load(PropertiesUtil.class.getClassLoader().getResourceAsStream("prop.properties"));
        } catch (IOException e) {
            throw new RuntimeException("找不到prop.properties文件", e);
        }
    }

    public static String getPropValue(String key) {
        return prop != null ? prop.getProperty(key) : "";
    }
}
